Welcome to the airquality package. This package uses various data from the .
It includes various functions that help you to get an overview about the airquality in any town. You can:
In the following, each function is explained in detail and examples are provided.
#github_install can only be added when the week 3 branch is merged
#install_github('Programming-The-Next-Step-2022/airquality')
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_aq_df("Amsterdam", "NL")
## Component Index / Concentration
## 1 AQI 2.00
## 2 CO 211.95
## 3 NO 0.88
## 4 NO2 3.13
## 5 O3 97.28
## 6 SO2 2.21
## 7 PM2_5 2.15
## 8 PM_10 7.01
## 9 NH3 0.70
To display the output to users in a nicer way, you can use the gt::gt() function
gt(current_aq_df())
| Component | Index / Concentration |
|---|---|
| AQI | 2.00 |
| CO | 211.95 |
| NO | 0.88 |
| NO2 | 3.13 |
| O3 | 97.28 |
| SO2 | 2.21 |
| PM2_5 | 2.15 |
| PM_10 | 7.01 |
| NH3 | 0.70 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a plot showing the average AQI per day over the last two weeks.
plot_aqi_hist("Paris", "FRA")
This function takes the city, the country (use ISO 3166 country codes), and the desired subcomponent (e.g., co) as arguments. It outputs a plot showing the average concentration of for example carbon monoxide over the last two weeks.
plot_comp_hist("Rome", "ITA", "co")
This function shows the current AQI in the ten largest European cities. The values are colored according the AQI.
current_aq_table()
| Current Airquality Index (AQI) of Top 10 Major Europan Cities | |
|---|---|
| Cities | AQI |
| Istanbul | 5 |
| London | 2 |
| Berlin | 2 |
| Madrid | 2 |
| Kyiv | 2 |
| Rome | 4 |
| Bucharest | 3 |
| Paris | 1 |
| Vienna | 2 |
| Hamburg | 2 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_weather("Berlin", "GER")
| Component | Data |
|---|---|
| Current Weather | scattered clouds |
| Current Temperature | 16.89 |
| Feels Like Temperature | 16.1 |
| Min Temperature | 15.61 |
| Max Temperature | 18.38 |
| Air Pressure | 1011 |
| Humidity | 56 |
| Visibility | 10000 |
| Wind Speed | 12.86 |
| Wind Direction | 280 |
| Sunrise | 1653620086 |
| Sunset | 1653678765 |